package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.TemplateType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/11/15.
 */
@Entity
@Table(name = "templates")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class Template extends IDEntityMall {

    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;


    @Column(columnDefinition = "varchar(255) comment '标题'")
    private String title;


    @Column(columnDefinition = "varchar(11) comment '模板类型'")
    @Enumerated(EnumType.STRING)
    private TemplateType type;


    @Column(columnDefinition = "MEDIUMTEXT comment '编辑内容'")
    private String content;

    @Column(columnDefinition = "int(20) comment '序号(排序字段)'")
    private Integer seqNo;


    public final static String UP = "UP";
    public final static  String DOWN = "DOWN";


    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public TemplateType getType() {
        return type;
    }

    public void setType(TemplateType type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(Integer seqNo) {
        this.seqNo = seqNo;
    }

    @Override
    public String toString() {
        return "Template{" +
                "mallId=" + mallId +
                ", title='" + title + '\'' +
                ", type=" + type +
                ", content='" + content + '\'' +
                ", seqNo=" + seqNo +
                '}';
    }
}
